const MongoClient = require('mongodb').MongoClient;
const url = "mongodb://taosha_user:apyl8XWP6LSW4JHs@101.35.6.34:27722/taosha";

async function main() {
  const client = await MongoClient.connect(url, {useNewUrlParser: true, useUnifiedTopology: true});
  const db = client.db('taosha');


  const result = await db.collection('topics')
    .updateMany({tab: 'tech', title: /架构/},
      {$addToSet: {boards: '架构'}}
    );

  console.log(result.result);

  client.close();

}

main();
